Skip to content

Block Vercel's Toolbar during Lighthouse and keep failed audit IDs - #228

Merged
lwwmanning merged 1 commit into
mainfrom
wm/lighthouse-block-vercel-toolbar
Nov 21, 2026
Merged

lwwmanning merged 1 commit into
mainfrom
wm/lighthouse-block-vercel-toolbar

Conversation

@lwwmanning

Copy link
Copy Markdown
Contributor

What changes

This changes the Lighthouse jobs in .github/workflows/lighthouse.yml and their settings in lighthouserc.cjs, for both sites. The thresholds, the axe job, and the preview proxy are unchanged.

Before, Vercel's Toolbar could load from vercel.live on a PR preview, even with the proxy's x-vercel-skip-toolbar header. The Toolbar can set a third-party cookie, which fails third-party-cookies (weight 5) and inspector-issues (weight 1). That leaves 21 of 27 points, and best practices scores 0.78. On 2026-11-20, #227 scored 0.78 on all five pages in two attempts, and 1.00 in a later run. The Toolbar is the likely cause, but those runs did not record which audits failed.

After, Lighthouse blocks vercel.live and pusher.com during collection. Production never loads the Toolbar, and Lighthouse ignores a blocked request in errors-in-console.

Before, each job kept only the category scores, and the assertion log names only the category. After, each job also keeps the IDs of the scored audits below 1 for each category, and prints them in its log. The IDs are Lighthouse's audit names, not page content. The score comment is unchanged.

How it was checked

The 0.78 matches the weights in a Lighthouse 12.6.1 report, the version that the pinned action uses. The Lighthouse 12.6.1 source ignores ERR_BLOCKED_BY_CLIENT.Inspector in errors-in-console. The new workflow step ran under bash on two saved reports, and scripts/lighthouse-comment.sh still reads its output. This PR's own Lighthouse run tests the block on a preview. It tests the fix only if the Toolbar sets its cookie during that run.

  • Every commit is signed off (git commit -s), for the DCO check.
  • bun run check:ci passes.

🤖 Generated with Claude Code

On 2026-11-20, best practices fell to 0.78 on all five pages of a PR
preview, in two attempts, and a later run of the same PR scored 1.00.
A local build scores 1.00. Vercel adds its Toolbar to previews from
vercel.live, and the Toolbar can set a third-party cookie even with
the proxy's x-vercel-skip-toolbar header. That fails
third-party-cookies (weight 5) and inspector-issues (weight 1), which
leaves 21 of 27 weighted points: 0.78.

lighthouserc.cjs now blocks vercel.live and pusher.com during
collection. Production never loads the Toolbar, and Lighthouse ignores
a blocked request in errors-in-console.

CI kept only category scores, so the failed run did not record which
audits failed. Each Lighthouse job now also keeps the IDs of the
scored audits below 1, per category, and prints them in its log.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Will Manning <will@willmanning.io>
@vercel

vercel Bot commented Nov 21, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
vortex.dev Ready Ready Preview Nov 21, 2026 1:35am UTC

Request Review

@lwwmanning
lwwmanning marked this pull request as ready for review November 21, 2026 01:35
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-21T01:37:11.864986Z 951ec84 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

Copy link
Copy Markdown

🔦 Lighthouse audit

URL Perf A11y Best practices SEO
/ 🟢 100 🟢 100 🟢 100 🟢 100
/bench 🟢 100 🟢 100 🟢 100 🟢 100
/bench/chart/ct.eyJrIjoiQ29tcHJlc3Npb25UaW1lIiwiZGF0YXNldCI6ImFyYWRlIiwiZGF0YXNldF92YXJpYW50IjpudWxsfQ 🟢 100 🟢 100 🟢 100 🟢 100
/blog 🟢 100 🟢 100 🟢 100 🟢 100
/blog/btrblocks-compressor 🟢 100 🟢 100 🟢 100 🟢 100

Run 44851101220 · 2026-11-21 01:38 UTC

@lwwmanning
lwwmanning merged commit 72c957f into main Nov 21, 2026
20 checks passed
@lwwmanning
lwwmanning deleted the wm/lighthouse-block-vercel-toolbar branch November 21, 2026 01:41

This branch was successfully deployed

1 active deployment
Preview — 951ec844 Deployed Nov 21, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant